from xml.etree.ElementTree import tostring
from alg import *

class Test:

    def testing() -> None:
        s = ["catsanddog","pineapplepenapple","catsandog"]
        wordDict = [["cat","cats","and","sand","dog"],
                    ["apple","pen","applepen","pine","pineapple"],
                    ["cats","dog","sand","and","cat"]]
        print("-------------------------------------------------")
        for i in range(3):
            re = Solution.wordBreak(s[i], wordDict[i])
            print("Input:s={}, wordDict={}".format(s[i], wordDict[i]))
            print("Output: ", re[0], "\nTimeCost:{:.3f}ms".format(re[1]))
            print("-------------------------------------------------")


if __name__ == "__main__":
    Test.testing()
        